package com.yunsc.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunsc.product.dao.YunscSpecValueDao;
import com.yunsc.product.entity.YunscSpecValueEntity;
import com.yunsc.product.service.YunscSpecValueService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;




@Service("yunscSpecValueService")
public class YunscSpecValueServiceImpl extends ServiceImpl<YunscSpecValueDao, YunscSpecValueEntity> implements YunscSpecValueService {


    @Override
    public YunscSpecValueEntity getSpecValueId(String specValue) {
        if (StringUtils.isEmpty(specValue)) {
            return null;
        }
        YunscSpecValueEntity specValueEntity = this.getOne(new QueryWrapper<YunscSpecValueEntity>().eq("spec_value", specValue));
        return specValueEntity;
    }
}